<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../../">
  <title data-ice="title">src/validator/Validator.unit.js | formiojs</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
  <script src="script/prettify/prettify.js"></script>
  <script src="script/manual.js"></script>
<meta name="description" content="JavaScript powered Forms with JSON Form Builder"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="formiojs"><meta property="twitter:description" content="JavaScript powered Forms with JSON Form Builder"></head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="./">Home</a>
  
  <a href="identifiers.html">Reference</a>
  <a href="source.html">Source</a>
  
  <div class="search-box">
  <span>
    <img src="./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
<a style="position:relative; top:3px;" href="https://github.com/formio/formio.js"><img width="20px" src="./image/github.png"></a></header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/EventEmitter.js~EventEmitter.html">EventEmitter</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/Form.js~Form.html">Form</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/FormBuilder.js~FormBuilder.html">FormBuilder</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/Formio.js~Formio.html">Formio</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/PDF.js~PDF.html">PDF</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/PDFBuilder.js~PDFBuilder.html">PDFBuilder</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/Webform.js~Webform.html">Webform</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/WebformBuilder.js~WebformBuilder.html">WebformBuilder</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/Wizard.js~Wizard.html">Wizard</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/WizardBuilder.js~WizardBuilder.html">WizardBuilder</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#builders">builders</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/builders/Builders.js~Builders.html">Builders</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components">components</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/Components.js~Components.html">Components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-component">components/_classes/component</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/_classes/component/Component.js~Component.html">Component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Component">Component</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-component-editform">components/_classes/component/editForm</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EditFormUtils">EditFormUtils</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-componentmodal">components/_classes/componentModal</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/_classes/componentModal/ComponentModal.js~ComponentModal.html">ComponentModal</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-field">components/_classes/field</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/_classes/field/Field.js~Field.html">Field</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-input">components/_classes/input</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/_classes/input/Input.js~Input.html">Input</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-multivalue">components/_classes/multivalue</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/_classes/multivalue/Multivalue.js~Multivalue.html">Multivalue</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-nested">components/_classes/nested</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/_classes/nested/NestedComponent.js~NestedComponent.html">NestedComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-NestedComponent">NestedComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-nestedarray">components/_classes/nestedarray</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/_classes/nestedarray/NestedArrayComponent.js~NestedArrayComponent.html">NestedArrayComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components--classes-nesteddata">components/_classes/nesteddata</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/_classes/nesteddata/NestedDataComponent.js~NestedDataComponent.html">NestedDataComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-address">components/address</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/address/Address.js~AddressComponent.html">AddressComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Address">Address</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-AddressComponentMode">AddressComponentMode</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-button">components/button</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/button/Button.js~ButtonComponent.html">ButtonComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Button">Button</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-checkbox">components/checkbox</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/checkbox/Checkbox.js~CheckBoxComponent.html">CheckBoxComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Checkbox">Checkbox</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-columns">components/columns</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/columns/Columns.js~ColumnsComponent.html">ColumnsComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Columns">Columns</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-container">components/container</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/container/Container.js~ContainerComponent.html">ContainerComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Container">Container</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-content">components/content</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/content/Content.js~ContentComponent.html">ContentComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Content">Content</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-currency">components/currency</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/currency/Currency.js~CurrencyComponent.html">CurrencyComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Currency">Currency</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-datagrid">components/datagrid</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/datagrid/DataGrid.js~DataGridComponent.html">DataGridComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-DataGrid">DataGrid</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-datamap">components/datamap</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/datamap/DataMap.js~DataMapComponent.html">DataMapComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-DataMap">DataMap</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-datetime">components/datetime</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/datetime/DateTime.js~DateTimeComponent.html">DateTimeComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-DateTime">DateTime</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-day">components/day</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/day/Day.js~DayComponent.html">DayComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Day">Day</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-editgrid">components/editgrid</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/editgrid/EditGrid.js~EditGridComponent.html">EditGridComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-EditGrid">EditGrid</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-email">components/email</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/email/Email.js~EmailComponent.html">EmailComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Email">Email</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-fieldset">components/fieldset</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/fieldset/Fieldset.js~FieldsetComponent.html">FieldsetComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Fieldset">Fieldset</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-file">components/file</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/file/File.js~FileComponent.html">FileComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-File">File</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-form">components/form</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/form/Form.js~FormComponent.html">FormComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Form">Form</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-hidden">components/hidden</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/hidden/Hidden.js~HiddenComponent.html">HiddenComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Hidden">Hidden</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-html">components/html</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/html/HTML.js~HTMLComponent.html">HTMLComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-HTML">HTML</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-number">components/number</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/number/Number.js~NumberComponent.html">NumberComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Number">Number</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-panel">components/panel</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/panel/Panel.js~PanelComponent.html">PanelComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Panel">Panel</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-password">components/password</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/password/Password.js~PasswordComponent.html">PasswordComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Password">Password</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-phonenumber">components/phonenumber</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/phonenumber/PhoneNumber.js~PhoneNumberComponent.html">PhoneNumberComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-PhoneNumber">PhoneNumber</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-radio">components/radio</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/radio/Radio.js~RadioComponent.html">RadioComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Radio">Radio</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-recaptcha">components/recaptcha</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/recaptcha/ReCaptcha.js~ReCaptchaComponent.html">ReCaptchaComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-ReCaptcha">ReCaptcha</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-resource">components/resource</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/resource/Resource.js~ResourceComponent.html">ResourceComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Resource">Resource</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-select">components/select</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/select/Select.js~SelectComponent.html">SelectComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Select">Select</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-selectboxes">components/selectboxes</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/selectboxes/SelectBoxes.js~SelectBoxesComponent.html">SelectBoxesComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-SelectBoxes">SelectBoxes</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-signature">components/signature</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/signature/Signature.js~SignatureComponent.html">SignatureComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Signature">Signature</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-survey">components/survey</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/survey/Survey.js~SurveyComponent.html">SurveyComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Survey">Survey</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-table">components/table</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/table/Table.js~TableComponent.html">TableComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Table">Table</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-tabs">components/tabs</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/tabs/Tabs.js~TabsComponent.html">TabsComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Tabs">Tabs</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-tags">components/tags</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/tags/Tags.js~TagsComponent.html">TagsComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Tags">Tags</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-textarea">components/textarea</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/textarea/TextArea.js~TextAreaComponent.html">TextAreaComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-TextArea">TextArea</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-textfield">components/textfield</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/textfield/TextField.js~TextFieldComponent.html">TextFieldComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-TextField">TextField</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-time">components/time</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/time/Time.js~TimeComponent.html">TimeComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Time">Time</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-tree">components/tree</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/tree/Node.js~Node.html">Node</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/tree/Tree.js~TreeComponent.html">TreeComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Tree">Tree</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-unknown">components/unknown</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/unknown/Unknown.js~UnknownComponent.html">UnknownComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Unknown">Unknown</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-url">components/url</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/url/Url.js~UrlComponent.html">UrlComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Url">Url</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-well">components/well</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/well/Well.js~WellComponent.html">WellComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Well">Well</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib">contrib</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-Contrib">Contrib</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-edittable">contrib/edittable</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/contrib/edittable/EditTable.js~EditTableComponent.html">EditTableComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-EditTable">EditTable</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-location">contrib/location</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/contrib/location/Location.js~LocationComponent.html">LocationComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-Location">Location</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-modaledit">contrib/modaledit</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/contrib/modaledit/ModalEdit.js~ModalEditComponent.html">ModalEditComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-ModalEdit">ModalEdit</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-stripe-checkout">contrib/stripe/checkout</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/contrib/stripe/checkout/StripeCheckout.js~StripeCheckoutComponent.html">StripeCheckoutComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-stripe-stripe">contrib/stripe/stripe</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/contrib/stripe/stripe/Stripe.js~StripeComponent.html">StripeComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#displays">displays</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/displays/Displays.js~Displays.html">Displays</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#providers">providers</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/providers/Providers.js~Providers.html">Providers</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#providers-address">providers/address</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/providers/address/AddressProvider.js~AddressProvider.html">AddressProvider</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/providers/address/AzureAddressProvider.js~AzureAddressProvider.html">AzureAddressProvider</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/providers/address/CustomAddressProvider.js~CustomAddressProvider.html">CustomAddressProvider</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/providers/address/GoogleAddressProvider.js~GoogleAddressProvider.html">GoogleAddressProvider</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/providers/address/NominatimAddressProvider.js~NominatimAddressProvider.html">NominatimAddressProvider</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#providers-storage">providers/storage</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-azure">azure</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-base64">base64</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-dropbox">dropbox</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-indexeddb">indexeddb</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-s3">s3</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-url">url</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-XHR">XHR</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#templates">templates</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/templates/Templates.js~Templates.html">Templates</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#templates-bootstrap">templates/bootstrap</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-iconClass">iconClass</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#utils">utils</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/utils/ChoicesWrapper.js~ChoicesWrapper.html">ChoicesWrapper</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkInvalidDate">checkInvalidDate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-lessOrGreater">lessOrGreater</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-applyFormChanges">applyFormChanges</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-eachComponent">eachComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-escapeRegExCharacters">escapeRegExCharacters</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-findComponent">findComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-findComponents">findComponents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-flattenComponents">flattenComponents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-formatAsCurrency">formatAsCurrency</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-generateFormChange">generateFormChange</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getComponent">getComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getStrings">getStrings</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getValue">getValue</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-hasCondition">hasCondition</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isLayoutComponent">isLayoutComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-matchComponent">matchComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-parseFloatExt">parseFloatExt</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-removeComponent">removeComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-searchComponents">searchComponents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-boolValue">boolValue</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-bootstrapVersion">bootstrapVersion</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkCalculated">checkCalculated</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkCondition">checkCondition</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkCustomConditional">checkCustomConditional</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkJsonConditional">checkJsonConditional</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkSimpleConditional">checkSimpleConditional</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkTrigger">checkTrigger</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-convertFormatToFlatpickr">convertFormatToFlatpickr</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-convertFormatToMask">convertFormatToMask</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-convertFormatToMoment">convertFormatToMoment</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-currentTimezone">currentTimezone</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-delay">delay</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-evaluate">evaluate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-fastCloneDeep">fastCloneDeep</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-fieldData">fieldData</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-formatDate">formatDate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-formatOffset">formatOffset</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getContextComponents">getContextComponents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCurrencyAffixes">getCurrencyAffixes</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getDateSetting">getDateSetting</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getElementRect">getElementRect</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getInputMask">getInputMask</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getLocaleDateFormatInfo">getLocaleDateFormatInfo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getNumberDecimalLimit">getNumberDecimalLimit</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getNumberSeparators">getNumberSeparators</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPropertyValue">getPropertyValue</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getRandomComponentId">getRandomComponentId</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-guid">guid</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isInputComponent">isInputComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isMongoId">isMongoId</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isValidDate">isValidDate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-iterateKey">iterateKey</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-loadZones">loadZones</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-matchInputMask">matchInputMask</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-momentDate">momentDate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-observeOverload">observeOverload</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-offsetDate">offsetDate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sanitize">sanitize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setActionProperty">setActionProperty</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-shouldLoadZones">shouldLoadZones</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-unfold">unfold</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-uniqueKey">uniqueKey</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-uniqueName">uniqueName</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-withSwitch">withSwitch</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-zonesLoaded">zonesLoaded</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-KEY_CODES">KEY_CODES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-Evaluator">Evaluator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-CALENDAR_ERROR_MESSAGES">CALENDAR_ERROR_MESSAGES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-firstNonNil">firstNonNil</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-interpolate">interpolate</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#utils-jsonlogic">utils/jsonlogic</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-lodashOperators">lodashOperators</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#validator">validator</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/validator/Rules.js~Rules.html">Rules</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/validator/Validator.js~ValidationChecker.html">ValidationChecker</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#widgets">widgets</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/widgets/CalendarWidget.js~CalendarWidget.html">CalendarWidget</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/widgets/InputWidget.js~InputWidget.html">InputWidget</a></span></span></li>
</ul>
</div>
</nav>

<div class="content" data-ice="content"><h1 data-ice="title">src/validator/Validator.unit.js</h1>
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">&apos;use strict&apos;;
import Validator from &apos;./Validator&apos;;
import Component from &apos;../components/_classes/component/Component&apos;;
import assert from &apos;power-assert&apos;;

describe(&apos;Legacy Validator Tests&apos;, () =&gt; {
  const baseComponent = new Component({});

  it(&apos;Should test for minLength&apos;, () =&gt; {
    assert.equal(Validator.validators.minLength.check(baseComponent, 5, &apos;test&apos;), false);
    assert.equal(Validator.validators.minLength.check(baseComponent, 4, &apos;test&apos;), true);
    assert.equal(Validator.validators.minLength.check(baseComponent, 3, &apos;test&apos;), true);
    assert.equal(Validator.validators.minLength.check(baseComponent, 6, &apos;test&apos;), false);
    assert.equal(Validator.validators.minLength.check(baseComponent, 6, &apos;&apos;), true);
  });

  it(&apos;Should test for maxLength&apos;, () =&gt; {
    assert.equal(Validator.validators.maxLength.check(baseComponent, 5, &apos;test&apos;), true);
    assert.equal(Validator.validators.maxLength.check(baseComponent, 4, &apos;test&apos;), true);
    assert.equal(Validator.validators.maxLength.check(baseComponent, 3, &apos;test&apos;), false);
    assert.equal(Validator.validators.maxLength.check(baseComponent, 6, &apos;test&apos;), true);
    assert.equal(Validator.validators.maxLength.check(baseComponent, 6, &apos;&apos;), true);
  });

  it(&apos;Should test for email&apos;, () =&gt; {
    assert.equal(Validator.validators.email.check(baseComponent, &apos;&apos;, &apos;test&apos;), false);
    assert.equal(Validator.validators.email.check(baseComponent, &apos;&apos;, &apos;test@a&apos;), false);
    assert.equal(Validator.validators.email.check(baseComponent, &apos;&apos;, &apos;test@example.com&apos;), true);
    assert.equal(Validator.validators.email.check(baseComponent, &apos;&apos;, &apos;test@a.com&apos;), true);
    assert.equal(Validator.validators.email.check(baseComponent, &apos;&apos;, &apos;test@a.co&apos;), true);
  });

  it(&apos;Should test for required&apos;, () =&gt; {
    assert.equal(Validator.validators.required.check(baseComponent, true, &apos;&apos;), false);
    assert.equal(Validator.validators.required.check(baseComponent, true, &apos;t&apos;), true);
    assert.equal(Validator.validators.required.check(baseComponent, false, &apos;&apos;), true);
    assert.equal(Validator.validators.required.check(baseComponent, false, &apos;tes&apos;), true);
    assert.equal(Validator.validators.required.check(baseComponent, true, undefined), false);
    assert.equal(Validator.validators.required.check(baseComponent, true, null), false);
    assert.equal(Validator.validators.required.check(baseComponent, true, []), false);
    assert.equal(Validator.validators.required.check(baseComponent, true, [&apos;test&apos;]), true);
  });

  it(&apos;Should test for custom&apos;, () =&gt; {
    assert.equal(Validator.validators.custom.check(baseComponent, &apos;valid = (input == &quot;test&quot;)&apos;, &apos;test&apos;), true);
    assert.equal(Validator.validators.custom.check(baseComponent, &apos;valid = (input == &quot;test&quot;)&apos;, &apos;test2&apos;), false);
    assert.equal(Validator.validators.custom.check(baseComponent, &apos;valid = (input == &quot;test&quot;) ? true : &quot;Should be false.&quot;&apos;, &apos;test2&apos;), &apos;Should be false.&apos;);
    assert.equal(Validator.validators.custom.check(baseComponent, &apos;valid = (input == &quot;test&quot;) ? true : &quot;Should be false.&quot;&apos;, &apos;test&apos;), true);
  });

  it(&apos;Should test for pattern&apos;, () =&gt; {
    assert.equal(Validator.validators.pattern.check(baseComponent, &apos;A.*&apos;, &apos;A&apos;), true);
    assert.equal(Validator.validators.pattern.check(baseComponent, &apos;A.*&apos;, &apos;Aaaa&apos;), true);
    assert.equal(Validator.validators.pattern.check(baseComponent, &apos;w+&apos;, &apos;test&apos;), false);
    assert.equal(Validator.validators.pattern.check(baseComponent, &apos;\\w+&apos;, &apos;test&apos;), true);
    assert.equal(Validator.validators.pattern.check(baseComponent, &apos;\\w+@\\w+&apos;, &apos;test@a&apos;), true);
    assert.equal(Validator.validators.pattern.check(baseComponent, &apos;\\w+@\\w+&apos;, &apos;test@example.com&apos;), false);
  });

  it(&apos;Should test for json&apos;, () =&gt; {
    assert.equal(Validator.validators.json.check(baseComponent, {
      or: [{ &apos;_isEqual&apos;: [{ var: &apos;data.test&apos; }, [&apos;1&apos;, &apos;2&apos;, &apos;3&apos;]] }, &apos;Should be false.&apos;]
    }, null, { test: [&apos;1&apos;, &apos;2&apos;, &apos;3&apos;] }), true);
    assert.equal(Validator.validators.json.check(baseComponent, {
      or: [{ &apos;_isEqual&apos;: [{ var: &apos;data.test&apos; }, [&apos;1&apos;, &apos;2&apos;, &apos;3&apos;]] }, &apos;Should be false.&apos;]
    }, null, { test: [&apos;1&apos;, &apos;2&apos;, &apos;4&apos;] }), &apos;Should be false.&apos;);
  });
});

describe(&apos;Validator Tests&apos;, () =&gt; {
  it(&apos;Validates for required&apos;, (done) =&gt; {
    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;required&apos;,
        }
      ]
    });
    assert.deepEqual(Validator.checkComponent(component, {}), [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;required&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;Test is required&apos;,
      }
    ]);
    done();
  });

  it(&apos;Overrides the message and level&apos;, (done) =&gt; {
    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;required&apos;,
          level: &apos;info&apos;,
          message: &apos;ABC&apos;,
        }
      ]
    });
    assert.deepEqual(Validator.checkComponent(component, {}, {}, true), [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;required&apos;,
        },
        level: &apos;info&apos;,
        message: &apos;ABC&apos;,
      }
    ]);
    done();
  });

  it(&apos;Only returns the last message for a rule&apos;, (done) =&gt; {
    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;required&apos;,
          level: &apos;info&apos;,
          message: &apos;ABC&apos;,
        },
        {
          rule: &apos;required&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
        }
      ]
    });
    assert.deepEqual(Validator.checkComponent(component, {}), [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;required&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ]);
    done();
  });

  it(&apos;Fulfills custom validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;custom&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;custom&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            custom: &apos;valid = input === &quot;foo&quot;;&apos;,
          }
        }
      ]
    });
    // Null is empty value so false passes for Component.
    component.dataValue = &apos;foo&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;bar&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = [];
    assert.deepEqual(Validator.checkComponent(component, {}), fail);

    done();
  });

  it(&apos;Fulfills date validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;date&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;date&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {}
        }
      ]
    });
    component.dataValue = &apos;01/05/12&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;January 5, 2012&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;2019-12-04T16:33:10.626Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = new Date();
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills day validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;day&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;day&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {}
        }
      ]
    });
    component.dataValue = &apos;01/05/2012&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;January 5, 2012&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;2019-12-04T16:33:10.626Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = new Date();
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills email validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;email&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;email&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {}
        }
      ]
    });
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;test&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;test@example&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;test@example.com&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;test.test@example.com&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;test.test@example.io&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills json validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;json&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;json&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            json: { &apos;==&apos; : [{ var: &apos;input&apos; }, &apos;foo&apos;] },
          }
        }
      ]
    });
    component.dataValue = &apos;foo&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;bar&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = [];
    assert.deepEqual(Validator.checkComponent(component, {}), fail);

    done();
  });

  it(&apos;Fulfills mask validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;mask&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;mask&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            mask: &apos;999&apos;,
          }
        }
      ]
    });
    component.dataValue = &apos;123&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;aaa&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;12&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;1234&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;1a2&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills max validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;max&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;max&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            limit: &apos;10&apos;,
          }
        }
      ]
    });
    component.dataValue = -1;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = 0;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = 1;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = 9;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = 10;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = 11;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = 1000000000;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;12&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills maxDate validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;maxDate&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;maxDate&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            dateLimit: &apos;2019-12-04T00:00:00.000Z&apos;,
          }
        }
      ]
    });
    component.dataValue = &apos;2010-12-03T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;2019-12-03T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;2019-12-04T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;2019-12-05T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;2029-12-05T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills maxLength validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;maxLength&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;maxLength&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            length: &apos;10&apos;,
          }
        }
      ]
    });
    component.dataValue = &apos;a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;123456789&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;123456789a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;1234567890a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;this is a really long string&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills maxWords validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;maxWords&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;maxWords&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            length: &apos;3&apos;,
          }
        }
      ]
    });
    component.dataValue = &apos;This&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;This is&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;This is a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;This is a test&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;this is a really long string&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills min validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;min&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;min&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            limit: &apos;10&apos;,
          }
        }
      ]
    });
    component.dataValue = -1;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = 0;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = 1;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = 9;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = 10;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = 11;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = 1000000000;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;12&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills minDate validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;minDate&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;minDate&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            dateLimit: &apos;2019-12-04T00:00:00.000Z&apos;,
          }
        }
      ]
    });
    component.dataValue = &apos;2010-12-03T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;2019-12-03T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;2019-12-04T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;2019-12-05T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;2029-12-05T00:00:00.000Z&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills minLength validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;minLength&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;minLength&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            length: &apos;10&apos;,
          }
        }
      ]
    });
    component.dataValue = &apos;a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;123456789&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;123456789a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;1234567890a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;this is a really long string&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills minWords validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;minWords&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;minWords&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            length: &apos;3&apos;,
          }
        }
      ]
    });
    component.dataValue = &apos;This&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;This is&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;This is a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;This is a test&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;this is a really long string&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills pattern validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;pattern&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;pattern&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
          settings: {
            pattern: &apos;a.c&apos;,
          }
        }
      ]
    });
    component.dataValue = &apos;abc&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;adc&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;aaa&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;ccc&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;a&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = [];
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = [&apos;abc&apos;];
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills required validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;required&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;required&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
        }
      ]
    });
    // Null is empty value so false passes for Component.
    component.dataValue = false;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = true;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;t&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;test&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = [];
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = [&apos;test&apos;];
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });

  it(&apos;Fulfills url validation&apos;, (done) =&gt; {
    const fail = [
      {
        context: {
          index: 0,
          key: &apos;test&apos;,
          label: &apos;Test&apos;,
          validator: &apos;url&apos;,
        },
        level: &apos;error&apos;,
        message: &apos;DEF&apos;,
      }
    ];

    const pass = [];

    const component = new Component({
      key: &apos;test&apos;,
      label: &apos;Test&apos;,
      validations: [
        {
          rule: &apos;url&apos;,
          level: &apos;error&apos;,
          message: &apos;DEF&apos;,
        }
      ]
    });
    component.dataValue = &apos;t&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;test&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;test.com&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;http://test&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), fail);
    component.dataValue = &apos;http://test.com&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;https://test.com&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;https://www.test.com&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;https://one.two.three.four.test.io&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;https://www.test.com/test&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;https://www.test.com/test/test.html&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;https://www.test.com/one/two/three/four/test.html&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = &apos;&apos;;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = undefined;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);
    component.dataValue = null;
    assert.deepEqual(Validator.checkComponent(component, {}), pass);

    done();
  });
});
</code></pre>

</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>

<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
